package com.noahplat.alarm.mapper;

import com.noahplat.alarm.pojo.Alarm;
import com.noahplat.person.pojo.Person;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.List;


/**
 * 作者：宋彦磊
 * 描述：报警信息mapper
 * 时间：2021-03-15
 */
public interface AlarmMapper extends Mapper<Alarm> {
    @Insert("<script> INSERT INTO tb_alarm(pid,acctid,uid,imei,alarm,type,user,state,addtime) VALUES <foreach collection = 'list' item='record' separator=','>" +
            "(#{record.id},#{record.acctid},#{record.userid},#{imei},#{alarm},#{type},#{user},#{state},#{addtime})</foreach></script>")
    int insertAlarm(@Param("list") List<Person> list, @Param("imei") String imei, @Param("alarm") String alarm,@Param("type") String type, @Param("user") String user, @Param("state") String state, @Param("addtime") Date addtime);
}
